import  Mock from 'mockjs'



const  roles = Mock.mock({
     "list|5":[
         {
              "roleId|+1":1,
               name:function () {
                    return "角色"+this.roleId;
               }
         }
     ]
}).list;

const  users =[
    {
        userId:1,
        username:'admin',
        role:{
            roleId:1,
            name:"角色1"
        },
        password:'admin'
}, {
        userId:2,
        username:'test',
        role:{
            roleId:2,
            name:"角色2"
        },
        password:'test'
    }
]





//拦截规则
Mock.mock('http://test.org/users','get',users); // url,method,data
Mock.mock("http://test.org/roles",'get',roles);
Mock.mock("http://test.org/role/save","post",true);